﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Text;
using System.Windows.Forms;
using DevExpress.XtraEditors;
using Class_KetNoi;

namespace GiaoDien
{
    public partial class uc_ChiTietLuongNhanVien : DevExpress.XtraEditors.XtraUserControl
    {
        public uc_ChiTietLuongNhanVien()
        {
            InitializeComponent();
        }
        KetNoi_BangLuong kn = new KetNoi_BangLuong();
        public void LoadDuLieu()
        {
            gridControl1.DataSource = kn.Load_TraCuuLuongNhanVien();
        }
        private void uc_ChiTietLuongNhanVien_Load(object sender, EventArgs e)
        {
            kn.connect();
            LoadDuLieu();
        }
        private void btnTimKiem_Click(object sender, EventArgs e)
        {
            try
            {
                gridControl1.DataSource = kn.TraCuu_LuongNhanVien(txtThang.Text, txtNam.Text, txtMaNV.Text);
                errorProvider1.Clear();
            }
            catch (Exception)
            {
                errorProvider1.SetError(btnTimKiem,"Các Dữ Liệu Đầu Vào Phải Là Số Từ 1-9");
            }
        }

        private void btnLamMoi_Click(object sender, EventArgs e)
        {
            LoadDuLieu();
        }


    }
}
